<template>
  <div class="tabsBox">
    <div class="file_part">
      <div class="file_head_div">
        <div class="file_head_title">
          <a-icon type="sound" :style="{ color: '#08c', marginRight: '10px' }" />
          通知被申请人
        </div>
      </div>
      <a-divider></a-divider>
      <SuperviseReplyCaseProce
        :applyid="applyid"
        :category="category"
        :isEditModel="isEditModel"
      />
    </div>
    <div class="file_part">
      <div class="file_head_div">
        <div class="file_head_title">
          <img src="@/assets/images/accept/sign.png" alt="监督决定" style="width: 16px;height: 16px;margin-right: 10px;" />
          <!-- <a-icon type="hourglass" :style="{ color: '#08c', marginRight: '10px' }" /> -->
          监督决定
        </div>
      </div>
      <a-divider></a-divider>
      <SuperviseReplyCaseDecisoin
        :applyid="applyid"
        :category="category"
        :processinstanceid="processinstanceid"
        :isEditModel="isEditModel"
        @changeRadio="feedBackCallBack"
      ></SuperviseReplyCaseDecisoin>
    </div>

    <div class="file_part" v-if="feedBackShow" >
      <div class="file_head_div">
        <div class="file_head_title">
          <a-icon type="edit" :style="{ color: '#08c', marginRight: '10px' }" />
          处理反馈
        </div>
      </div>
      <a-divider></a-divider>
      <SuperviseFeedBack
        ref="superviseFeedBack"
        :applyid="applyid"
        :taskid="taskid"
        :category="category"
        :isEditModel="isEditModel"
        :processinstanceid="processinstanceid"
      ></SuperviseFeedBack>
    </div>

  </div>
</template>
<script>
import { viewSupervise, saveSupervise } from '@/api/supervise/apl_supervise.js'
export default {
  props: {
    applyid: {
      type: String,
      required: true
    },
    taskid: {
      type: String,
      required: true
    },
    category: {
      type: String,
      required: false
    },
    isEditModel: {
      type: Boolean,
      required: false
    },
    processinstanceid: {
      type: String,
      default: '',
      required: true
    }
  },
  data () {
    return {
      feedBackShow: false, // 处理反馈展示
      superviseObj: {}
    }
  },
  async created () {
    // 查询当前的复议监督实体数据
    // 决定阶段
    const res = await viewSupervise(this.applyid).finally(() => {
      this.spinning = false
    })
    // this.spinning = false
    if (res.code === 0) {
      this.superviseObj = res.data ? res.data : {}
      if (this.superviseObj.isrectifica == 3200) {
        this.feedBackShow = true
      }
    } else {
      this.$message.error('查询复议监督数据异常')
    }
    if (this.category === 'rectify') {
      this.feedBackShow = true
    }
  },
  components: {
    SuperviseReplyCaseProce: () => import('@/views/supervise/SuperviseReplyCaseProce.vue'),
    SuperviseReplyCaseDecisoin: () => import('@/views/supervise/SuperviseReplyCaseDecisoin.vue'),
    SuperviseFeedBack: () => import('@/views/supervise/SuperviseFeedBack.vue')
  },
  methods: {
    feedBackCallBack (val) {
      if (val === 3200) {
        this.feedBackShow = true
      } else {
        this.feedBackShow = false
      }
    }
  }
}
</script>

<style scoped>
.tabsBox {
  height: 65vh;
  overflow: auto;
  padding: 10px 16px;
}

.file_part {
  margin: 16px 0px 32px 0px;
}
.file_head_div {
  display: flex;
  flex-direction: row;
  align-items: center;
}
.file_head_title {
  display: flex;
  align-items: center;
  width: 40%;

  font-family: PingFang SC;
  font-weight: bold;
  font-size: 18px;
  color: #000000;
  line-height: 5px;
}
.file_head_btn {
  display: flex;
  justify-content: flex-end;
  align-self: flex-end;
  width: 60%;
}
</style>
